package com.aaa.system.Controller.Api;

import com.aaa.entity.CheckItem;
import com.aaa.system.aop.annotation.Log;
import com.aaa.system.service.InsFeeService;
import com.aaa.vo.Result;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@RestController
@RequestMapping("system/api/insFee")
public class ApiInsFeeContriller {

    @Resource
    private InsFeeService insFeeService;

    /**
     *查询全部的检查项目数据
     */
    @PostMapping("getAllList/{current}/{size}")
    public Result<IPage<CheckItem>> getInsFeeList(@PathVariable Long current, @PathVariable Long size, @RequestBody CheckItem checkItem){
        return insFeeService.findAllInsFeeData(current,size,checkItem);
    }
    /**
     * 添加/修改检查项目
     */
    @PostMapping("addInsFee")
    @Log(title = "添加/修改检查项目",business_type = "1")
    public Result<Boolean> saveOrUpdateInsFee(@RequestBody CheckItem checkItem){
        return insFeeService.saveOrUpdateInsFee(checkItem);
    }
    /**
     * 删除/批量删除检查项目
     */
    @DeleteMapping("delInsFee/{checkItemIds}")
    @Log(title = "删除/批量删除检查项目",business_type = "3")
    public Result<Boolean> delInsFeeData(@PathVariable Long[] checkItemIds){
        return insFeeService.delInsFeeData(checkItemIds);
    }
}
